package com.bjsdzk.collector.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.StringVendorExtension;
import springfox.documentation.service.VendorExtension;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;


@Configuration
public class Swagger2 {

    @Bean
    public Docket createRestApi() {
    	Docket build = new Docket(DocumentationType.SWAGGER_2)
        .apiInfo(apiInfo())
        .select()
        .apis(RequestHandlerSelectors.basePackage("com.bjsdzk.collector.controller"))
        .paths(PathSelectors.any())
        .build();
        return build;
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
        		
                .title("胜顶智控对接平台api文档，简单优雅的restful风格")
                .description("")
                //.termsOfServiceUrl("http://yun3.bjsdzk.com")
                //.contact(new Contact("a","b","c"))
                .version("1.0")
                .license("胜顶智控物联网平台")
                .licenseUrl("http://yun3.bjsdzk.com")
                .build();
    }
}
